Right now xen will create a new vtpm instance everytime you start up a
domU, even if you specify the instance parameter in your config file.
Each vtpm instance is then given a uuid and the vtpm.db file maps
instance numbers to uuid numbers.
This patch is a hack that lets you explicitly set the uuid of your
vtpm instance. Everytime you boot up your domU now the vtpm will get
that uuid and thus it will always get the same vtpm instance number
instead of being generated a new one.
So for example, in your config file you would do something like this
vtpm = [ 'backend=0,uuid=
dcdb124b-9fed-4040-b149-
dd2dfd8d094c' ]
Signed-off-by: Matt Fioravante <Matthew.Fioravante@jhuapl.edu>
if len(vtpm) > 0:
d = vtpm[0]
instance = d.get('instance')
+ uuid = d.get('uuid')
if instance == "VTPMD":
instance = "0"
else:
config_vtpm.append(['backend', backend])
if typ:
config_vtpm.append(['type', type])
+ if uuid:
+ config_vtpm.append(['uuid', type])
config_devs.append(['device', config_vtpm])
(k, v) = b.strip().split('=', 1)
k = k.strip()
v = v.strip()
- if k not in ['backend', 'instance']:
+ if k not in ['backend', 'instance', 'uuid']:
err('Invalid vtpm specifier: ' + vtpm)
d[k] = v
vtpms.append(d)